class People:

    p_nation = '中国'
    def __init__(self, name, age):
        # 通过下面和实例绑定
        self.name = name
        self.age = age
        print(name, ':', age)

    def eat(self):
        print(self.name,'吃什么')

p = People('小明', '20')

p.p_nation ='美国'
print(p.p_nation) # 美国
print(People.p_nation) # 中国
p.eat()
